﻿var actions = [
            { action: "topnnews", objid: "_topnews" },
            { action: "getroomad", objid: "marqueeList" },
            { action: "getRoomList", objid: "_roomOrder" }
            ];

function getTopNews() {
    var url = "queryInfo.ashx?t=" + new Date().getTime() + "&";
    var pars = "action=topnnews";
    var ajax =new Ajax.Request(
                    url,
                    { method: 'get', parameters: pars, onComplete: showDestObj }
                    );

                    function showDestObj(txt) {
                        $('_topnews').innerHTML = txt.responseText;
                    }
                }

                function getMarquee() {
                    var url = "queryInfo.ashx?t=" + new Date().getTime() + "&";
                    var pars = "action=getroomad";
                    var ajax = new Ajax.Request(
                    url,
                    { method: 'get', parameters: pars, onComplete: showDestObj }
                    );

                    function showDestObj(txt) {
                        $('marqueeList').innerHTML = txt.responseText;
                    }
                 }

                 function getRoomList() {
                     var url = "queryInfo.ashx?t=" + new Date().getTime() + "&";
                     var pars = "action=getRoomList";
                     var ajax = new Ajax.Request(
                    url,
                    { method: 'get', parameters: pars, onComplete: showDestObj }
                    );

                     function showDestObj(txt) {
                         $('_roomOrder').innerHTML = txt.responseText;
                     }
                 }


                 function joinRoom(chnlId, roomId, ipAddr, ipLen) {
                     try {
                         var o = new ActiveXObject('VSpeed.ExeCheck');
                         var ret;
                         o.StartVSpeedClient(ret);
                         o.EnterRoom(chnlId, roomId, ipAddr, ipLen);
                     }
                     catch (e) {
                         window.showModalDialog('http://www.videospeedy.com/download_s.html', window, 'dialogwidth:662px;dialogheight:327px;help:0;center:yes;resizable:0;status:0;scroll:no');
                     }
                     return false;
                 }